package com.hrc.springboot.mapper;

import com.hrc.springboot.bean.Employee;
import org.apache.ibatis.annotations.*;

@Mapper
public interface EmployeeMapper {

    @Select("select * from employee where id = #{id}")
    Employee getEmpById(@Param("id") Integer id);

    @Update("update employee set lastName = #{lastName}, email = #{email}, gender = #{gender} ,d_id = #{dId}")
    void updateEmp(Employee employee);

    @Delete("delete from employee where id = #{id}")
    void deleteEmpById(@Param("id") Integer id);

    @Insert("insert into employee(lastName, email, gender, d_id) values(#{lastName}, #{email}, #{gender}, #{d_id})")
    void insertEmp(Employee employee);

    @Select("select * from employee where lastName = #{lastName}")
    Employee getEmpByLastName(@Param("lastName") String lastName);
}
